package com.edu.bhu.admin.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.edu.bhu.admin.mapper.HouHouseAndImagesMapper;
import com.edu.bhu.admin.domain.HouHouseAndImages;
import com.edu.bhu.admin.service.IHouHouseAndImagesService;
import com.edu.bhu.common.core.text.Convert;

/**
 * 房屋图片关联Service业务层处理
 * 
 * @author zhangkeyi
 * @date 2022-02-22
 */
@Service
public class HouHouseAndImagesServiceImpl implements IHouHouseAndImagesService 
{
    @Autowired
    private HouHouseAndImagesMapper houHouseAndImagesMapper;

    /**
     * 查询房屋图片关联
     * 
     * @param houseId 房屋图片关联主键
     * @return 房屋图片关联
     */
    @Override
    public HouHouseAndImages selectHouHouseAndImagesByHouseId(Long houseId)
    {
        return houHouseAndImagesMapper.selectHouHouseAndImagesByHouseId(houseId);
    }

    /**
     * 查询房屋图片关联列表
     * 
     * @param houHouseAndImages 房屋图片关联
     * @return 房屋图片关联
     */
    @Override
    public List<HouHouseAndImages> selectHouHouseAndImagesList(HouHouseAndImages houHouseAndImages)
    {
        return houHouseAndImagesMapper.selectHouHouseAndImagesList(houHouseAndImages);
    }

    /**
     * 新增房屋图片关联
     * 
     * @param houHouseAndImages 房屋图片关联
     * @return 结果
     */
    @Override
    public int insertHouHouseAndImages(HouHouseAndImages houHouseAndImages)
    {
        return houHouseAndImagesMapper.insertHouHouseAndImages(houHouseAndImages);
    }

    /**
     * 修改房屋图片关联
     * 
     * @param houHouseAndImages 房屋图片关联
     * @return 结果
     */
    @Override
    public int updateHouHouseAndImages(HouHouseAndImages houHouseAndImages)
    {
        return houHouseAndImagesMapper.updateHouHouseAndImages(houHouseAndImages);
    }

    /**
     * 批量删除房屋图片关联
     * 
     * @param houseIds 需要删除的房屋图片关联主键
     * @return 结果
     */
    @Override
    public int deleteHouHouseAndImagesByHouseIds(String houseIds)
    {
        return houHouseAndImagesMapper.deleteHouHouseAndImagesByHouseIds(Convert.toStrArray(houseIds));
    }

    /**
     * 删除房屋图片关联信息
     * 
     * @param houseId 房屋图片关联主键
     * @return 结果
     */
    @Override
    public int deleteHouHouseAndImagesByHouseId(Long houseId)
    {
        return houHouseAndImagesMapper.deleteHouHouseAndImagesByHouseId(houseId);
    }

    /**
     * 批量删除房屋图片关联（图片ID）
     *
     * @param imageIds 图片ID集合
     * @return 结果
     */
    public int deleteHouHouseAndImagesByImageIds(String imageIds)
    {
        return houHouseAndImagesMapper.deleteHouHouseAndImagesByImageIds(Convert.toStrArray(imageIds));
    }
}
